UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'r3/fef9bLXgWlxFRIOUBY6Zo/rS6OeDps0tE6QUYbHc=' 
WHERE 
  key_id = '7762d42058cc81664bcab1f5aa371a1b6b143b49a1af4ca9f8cb6bd14300138b' 
  AND (
    token = 'r3/fef9bLXgWlxFRIOUBY6Zo/rS6OeDps0tE6QUYbHc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035