UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SmYbb56ha0auQjVolsgsnmnP/DM0EeTy1OJUhgX4eFM=' 
WHERE 
  key_id = '8d0542c5a8767fad12f88a9fc2aac194de2a6d9d077b4406784236fc6bd2d428' 
  AND (
    token = 'SmYbb56ha0auQjVolsgsnmnP/DM0EeTy1OJUhgX4eFM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034