UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V3xib/uCpjs3Wh8wqV5sUNzKVSMO7wDOW3mZ6VSDnyM=' 
WHERE 
  key_id = '6b9b351ee5da15eda03c1d53d0b5fb3e7dd966d405137cdf7339674bd456bc67' 
  AND (
    token = 'V3xib/uCpjs3Wh8wqV5sUNzKVSMO7wDOW3mZ6VSDnyM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030