UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LuTfb7OXDUtGGPFy5JjjPzjJHyrW+fVzZFJz1lOEjUk=' 
WHERE 
  key_id = '95ed4e2f03649590b7ca8393520b4506912266cf37bde61531ab9f1cdd43aae3' 
  AND (
    token = 'LuTfb7OXDUtGGPFy5JjjPzjJHyrW+fVzZFJz1lOEjUk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032