UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UVR4ldHKLT1wDHJgGR0mra5wHsrV0YGNUskQCu8s9Pk=' 
WHERE 
  key_id = '41073db1f58c39355b72ef12ab085f0937d2c1f40b9f981999c9c48b4ee52f55' 
  AND (
    token = 'UVR4ldHKLT1wDHJgGR0mra5wHsrV0YGNUskQCu8s9Pk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022