UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Gyuy6WqPsUUkxsLzUU1QBJd53K0QTBlgmhxCMDJUXmI=' 
WHERE 
  key_id = '9cf4e4c5b52f3b6dfeadb7958f42e4e4fe75d08cf43e1cf4a46edc912781d02a' 
  AND (
    token = 'Gyuy6WqPsUUkxsLzUU1QBJd53K0QTBlgmhxCMDJUXmI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018