UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TZ+gDh4iNCJvdJsAr78TTxeJt61lvixtfQi1HltVO9o=' 
WHERE 
  key_id = '758db42bbd62e9b36715028a1dd245d3da9e6df2116ace1e2407a695d32090e4' 
  AND (
    token = 'TZ+gDh4iNCJvdJsAr78TTxeJt61lvixtfQi1HltVO9o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028