UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SdnnyjQvzDX2XXE/ojKbP8tz2T2zDfK1f2+FKUPB8Tk=' 
WHERE 
  key_id = '49098e959002498dc5ef78d389c91c9b87890538115921022cb7342e76f2d436' 
  AND (
    token = 'SdnnyjQvzDX2XXE/ojKbP8tz2T2zDfK1f2+FKUPB8Tk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037