UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xXieJxMTePUO3SW3WalN3tQ8EV8yvuqkZ2nkarf+dNM='
WHERE
key_id = 'fe5df2e1adcf283006235be3c790c91a1ce9a98769a25196648f2df0a5d8ab3b'
AND (
token = 'xXieJxMTePUO3SW3WalN3tQ8EV8yvuqkZ2nkarf+dNM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)