UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2y4SV+b188U/ClsyleQ5D0G+gYEcjKYsKezLMshh2BM=' 
WHERE 
  key_id = '43a8952ad0bf93bd8c8cef5f9bc74bde9cb0e29823e2760f9a33b0b5bfc3de4c' 
  AND (
    token = '2y4SV+b188U/ClsyleQ5D0G+gYEcjKYsKezLMshh2BM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033