UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F5XVLIM+bZL46Z6i3S+T57H4AcaX9FmRj7Md3E5LL9Q=' 
WHERE 
  key_id = '077677048b9f19d73d215358b61cd036ffbccc8f1344703d7f78e0c7cde17b21' 
  AND (
    token = 'F5XVLIM+bZL46Z6i3S+T57H4AcaX9FmRj7Md3E5LL9Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019