UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7LuqAPJ3qwH1C4/YdzU85jODiTF7MPHvDw4poYCW5ag=' 
WHERE 
  key_id = 'adc9896b905dc36e0df2accb58afc2743d2b8f43d995c9514f4a4306c9524b37' 
  AND (
    token = '7LuqAPJ3qwH1C4/YdzU85jODiTF7MPHvDw4poYCW5ag=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053