UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hNSOz8uqtxZ+5EXK0XTIyu5Ii3ZWEvYijm6gfP9YsxA=' 
WHERE 
  key_id = '6bc154362b010f810a97798d2e13cb3ae0b2ad8a672cbb078ed7a80102cd5d57' 
  AND (
    token = 'hNSOz8uqtxZ+5EXK0XTIyu5Ii3ZWEvYijm6gfP9YsxA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039