UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pvzsqiKu5SqTBJwwWztGd91LF+tKYkqFnzeTGTqEbF8=' 
WHERE 
  key_id = '5e118b4ec6de1320a980e4750d7450706b0c7a0e8c047939f0a233ab903802e6' 
  AND (
    token = 'pvzsqiKu5SqTBJwwWztGd91LF+tKYkqFnzeTGTqEbF8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023