UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zNSgLX3qzZZLCIq2Nj6RVu9ryuaPXsF2a1HWRxi/L9w=' 
WHERE 
  key_id = '6b9ca8cf3f36eab2800a424ca6ac9e460c38825748c34da206bfa9a564f250d9' 
  AND (
    token = 'zNSgLX3qzZZLCIq2Nj6RVu9ryuaPXsF2a1HWRxi/L9w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055