UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KUFx4Vmgq917AhyQGZCkdH2U3S9UfM1fBkmA69rQ/Xs=' 
WHERE 
  key_id = 'b1f2417b8b47d789cbc292ed804d8a4a24b8d677b8c8ddd38e2411eddfe7f015' 
  AND (
    token = 'KUFx4Vmgq917AhyQGZCkdH2U3S9UfM1fBkmA69rQ/Xs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031