UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MrbQC5dqzlokU8xmOGued1LgjFMTVcj9X6BnxSG/eAg=' 
WHERE 
  key_id = 'ff6c5f8e9811f3921af520f782c90e5d180d061956cc1747cbf21ef710208fc1' 
  AND (
    token = 'MrbQC5dqzlokU8xmOGued1LgjFMTVcj9X6BnxSG/eAg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018