UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c1KOhncnWitvAyv8+mg00LKCrU0hN6KkRjkfD5M1+6M=' 
WHERE 
  key_id = '3fcdff90afb6b9216b56ef189201c3153dbfd90ee03bb80ba37576060110d6ad' 
  AND (
    token = 'c1KOhncnWitvAyv8+mg00LKCrU0hN6KkRjkfD5M1+6M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052