UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ewasFcWbkHPulHCjrmyzouEf/kh+9qUaJt03QeD10fM=' 
WHERE 
  key_id = '1983aa9578b52e9c5df687fda69001ebb748da382a580b7b16a80b1184be9c91' 
  AND (
    token = 'ewasFcWbkHPulHCjrmyzouEf/kh+9qUaJt03QeD10fM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033