UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TWJjdj+ZfQCxTIrSEkJlMqyfiew7P1K9BB3HNasITtY=' 
WHERE 
  key_id = '2abe462ca39798defcdfbe2eda24f077333ec813cb5b44ad369d4b42bcbc64f0' 
  AND (
    token = 'TWJjdj+ZfQCxTIrSEkJlMqyfiew7P1K9BB3HNasITtY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031