UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oBoPnx3FmsY8WkE1OcbU15JGlw47xO+OkZ0uNmQ6Ock=' 
WHERE 
  key_id = 'ed50c72a1dc2ffc983d4bb2a3106aad0e3d9b727388808af7c454a3cd995761a' 
  AND (
    token = 'oBoPnx3FmsY8WkE1OcbU15JGlw47xO+OkZ0uNmQ6Ock=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016