UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5emTmvaIGgh6hj7rAsStKmWv4xkD8zdiQgqJ5qkwQFg=' 
WHERE 
  key_id = '3f4621e68a03fb04cf3c57f9f72c6fa95e49c184e4c04f2e628b4c2c10ffc323' 
  AND (
    token = '5emTmvaIGgh6hj7rAsStKmWv4xkD8zdiQgqJ5qkwQFg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033