UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BNXhD5IzEW9AwOKwbiX7Qh+QKzBceObtaehwdr80QoU=' 
WHERE 
  key_id = '36a4573b27386803bd58b5ee16fc2d28ae4b850a2e27a07e94fa5889c46f7cdb' 
  AND (
    token = 'BNXhD5IzEW9AwOKwbiX7Qh+QKzBceObtaehwdr80QoU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020