UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6XcnRtcH3VHJCuCmm6M4PXc4tltxbrCZ63ceSK+3jKs=' 
WHERE 
  key_id = 'e93482ce2daf4bedb4ec90af2f98ad1306f6adf0c7e184d32d659463c77254df' 
  AND (
    token = '6XcnRtcH3VHJCuCmm6M4PXc4tltxbrCZ63ceSK+3jKs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030