UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ByOxk3ZOnEwoqC0kVGq95smXdkcRk9Kggi7Harquc9A=' 
WHERE 
  key_id = '30b7ad5bf399ab6c61ffb506f83e60a73ca35e0d39ca6cfbee330796a23fd2db' 
  AND (
    token = 'ByOxk3ZOnEwoqC0kVGq95smXdkcRk9Kggi7Harquc9A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038