UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wRsqxMZQe5W7EjMSF2ZxQkAlzbSI+Zt2nIZA/h/CWRU='
WHERE
key_id = '875f663d73a7019a3c80c060b328e1975b716b2685e76c44e5b63935857ab4ac'
AND (
token = 'wRsqxMZQe5W7EjMSF2ZxQkAlzbSI+Zt2nIZA/h/CWRU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)