UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qm4ItfoYIcg7/Xc/B4To/X8+NGuwZn3Nb1U3G7P6i60='
WHERE
key_id = '29a95be847771d0476509dbc697c09cdcb47052d5e04d989f8ed96f915d7272f'
AND (
token = 'Qm4ItfoYIcg7/Xc/B4To/X8+NGuwZn3Nb1U3G7P6i60='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)