UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZhtEdeM53xlDTobiEwl93IXao+4Ovsc9rMmAxS1etIo=' 
WHERE 
  key_id = '0805bb49e50c96ec00ab82fb55412e4222efa1997c4f473e723b74a55b7b696f' 
  AND (
    token = 'ZhtEdeM53xlDTobiEwl93IXao+4Ovsc9rMmAxS1etIo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032