UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZaRnWJchV562UCO7HPkFVkV89fZVqRUXbJ2GDCyq0GE=' 
WHERE 
  key_id = '73dd53594da5c17ebb13c5b71eb3abca08dfb9c261c764fc859ec71cdcf49631' 
  AND (
    token = 'ZaRnWJchV562UCO7HPkFVkV89fZVqRUXbJ2GDCyq0GE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044