UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cbytg1+4O6PbPUpJ+KlWXhEuZww2dUOUEQQMqnh2juc=' 
WHERE 
  key_id = '2601ddbb1bd203f4d8e49ff9c7f4190fd2f9af0bb4f020ba16c1e610cc9b543f' 
  AND (
    token = 'cbytg1+4O6PbPUpJ+KlWXhEuZww2dUOUEQQMqnh2juc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037