UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Poy4kyalUmwWYf4bxNcPl+oRL+YkDs9xB3+mgSxy/rs=' 
WHERE 
  key_id = '0559a9cd46529417115de378df5e26314e91eb8ac053f2f924542954ac6cffad' 
  AND (
    token = 'Poy4kyalUmwWYf4bxNcPl+oRL+YkDs9xB3+mgSxy/rs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029