UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'og0gVhOTt6QYJFRqhTg7ng/hF/7kqLdYe+QnP7AoMNY=' 
WHERE 
  key_id = '9e0fcf65ae6c8f27ed03c37733445e7a620ececd1b1455d40e2a7347adb5cc3e' 
  AND (
    token = 'og0gVhOTt6QYJFRqhTg7ng/hF/7kqLdYe+QnP7AoMNY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050