UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mn0c/13R4SlFfwT7MF39s9FhOObqPKn+UKqg2j1dfhI=' 
WHERE 
  key_id = '4893d7fa4c3ae51103a85003e112a511cb6d367a1a191b6daf63406299abd5c1' 
  AND (
    token = 'Mn0c/13R4SlFfwT7MF39s9FhOObqPKn+UKqg2j1dfhI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058