UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KgqPoLk4FOJEkVufmESOgo/uHLvlmFQ/UCVZkfcoBwg=' 
WHERE 
  key_id = 'ff5d3d9acdac65c365cb69cd47f49bb1d68caba4500f1d1e7a205e8cf9d26520' 
  AND (
    token = 'KgqPoLk4FOJEkVufmESOgo/uHLvlmFQ/UCVZkfcoBwg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036