UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oAodkXY9g/lgpyzzPEnc+YG7NjmBg85XuSto5fNyEGg=' 
WHERE 
  key_id = '0106d66d82800915c664e672172e3380c962556cb69a687346d255df1b48f1f4' 
  AND (
    token = 'oAodkXY9g/lgpyzzPEnc+YG7NjmBg85XuSto5fNyEGg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034