UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vkyshYmESewj2I5jNPmuVv0W6G1Q0vb4D+RQa88NOhM=' 
WHERE 
  key_id = '12d3bc0f550f9cf2176470bb472d67b1844db0c7bea319fd0f4fd34823c2fe5c' 
  AND (
    token = 'vkyshYmESewj2I5jNPmuVv0W6G1Q0vb4D+RQa88NOhM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023