UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tmnpSKUmHD7dof48+i8779A0FSajfFhdTlDppaa229w='
WHERE
key_id = '3bfaeaddc1d1fbb5d8eb347de61d300ac6c25cd957d73be5012c21ad260c617e'
AND (
token = 'tmnpSKUmHD7dof48+i8779A0FSajfFhdTlDppaa229w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)