UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WZHKEDbMWVm056FG1SN//zIbrU5jFZ8FPlyQvyj5u48=' 
WHERE 
  key_id = 'bcabbf3839203fe9bc351e15ddef1c7bd5e5209fbd9586e3cc255dcaa05a942b' 
  AND (
    token = 'WZHKEDbMWVm056FG1SN//zIbrU5jFZ8FPlyQvyj5u48=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027