UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rbvEOwokzok7nzd1UOOnClt5RbjysqMB/whfofgKjXE=' 
WHERE 
  key_id = 'e65530645fae4832f7906d0cba525586ca5676f69baf81e153f416576e7c785f' 
  AND (
    token = 'rbvEOwokzok7nzd1UOOnClt5RbjysqMB/whfofgKjXE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00142