UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wBxFT8hwsC2HNNAxwbmAwwpCrwpMJJAqNv66r219fco=' 
WHERE 
  key_id = 'e16b8bf45c7a0926d474d5f1eff610d70bb8b924cbbea31e29f8c5f516db90fa' 
  AND (
    token = 'wBxFT8hwsC2HNNAxwbmAwwpCrwpMJJAqNv66r219fco=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028