UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MQLXlA/GtdIFpx/xbKSKpn4mIPai166uouVvUdEd1Qs='
WHERE
key_id = '5496e45d777f291db20a47f97e1921d204e7e090969fbce6bba45c4c4e8e968d'
AND (
token = 'MQLXlA/GtdIFpx/xbKSKpn4mIPai166uouVvUdEd1Qs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)