UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HoEpFnN9f4Ooro4Yy1rb1kYGI9pLNO3ununc8Yw6PAs=' 
WHERE 
  key_id = '237cb22713b75e44a4cd470ef39bab8679e49eb2020456d556c390fd25b72dba' 
  AND (
    token = 'HoEpFnN9f4Ooro4Yy1rb1kYGI9pLNO3ununc8Yw6PAs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039