UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u0vSMOxB/iseMzLlk2X3TJ7J093j7fElQtx71W/Nvi8=' 
WHERE 
  key_id = '0b0a0c9953b07e5f4caaab0390346b04cebfa3a28b2089e4a42d71e7e388de18' 
  AND (
    token = 'u0vSMOxB/iseMzLlk2X3TJ7J093j7fElQtx71W/Nvi8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049