UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wuhE9iJYHbKvT19pf9+6vjPip+netyre5xnWVo5tZx8=' 
WHERE 
  key_id = '7ba4097b6a5bc2bb9f2c93b5d96f0a268e4e4a9f481d261882fc1f6044ee997d' 
  AND (
    token = 'wuhE9iJYHbKvT19pf9+6vjPip+netyre5xnWVo5tZx8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045