UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qU9IBMgzzDgytdB17l+AGYJ9PHgpnBJ51lNst71fIIg=' 
WHERE 
  key_id = '8872805bb1d3414fdb0188a01b1d27e807fbabab630c9d1e48e5b0cf5852cef5' 
  AND (
    token = 'qU9IBMgzzDgytdB17l+AGYJ9PHgpnBJ51lNst71fIIg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032