UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '36V574SuXA2sXVfjkvrtGSIH+/L0ROh5r4zTLygo7QI='
WHERE
key_id = '46dabdaf6b332f2f9c3b7cb636bb884520efa8d3313c3a1a027c88f007faf74f'
AND (
token = '36V574SuXA2sXVfjkvrtGSIH+/L0ROh5r4zTLygo7QI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)