UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jsqtwxSL1gIvJBm2eCY6PpYzpJAfBSB6wFsVCaYWQjM=' 
WHERE 
  key_id = '152904a1595ea3c99e3f81eddc3930875f0587b067dd61432e4a48fc8868bdb6' 
  AND (
    token = 'jsqtwxSL1gIvJBm2eCY6PpYzpJAfBSB6wFsVCaYWQjM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027