UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mmbxcuHJVJpS/qvRF7sMiCrb+bOd009xxLQCHuJmmVM='
WHERE
key_id = '4b9ae9868eab6c060c1bf5a1573e6fe3865bf868c4c72b4ad24e1ca3329afed1'
AND (
token = 'mmbxcuHJVJpS/qvRF7sMiCrb+bOd009xxLQCHuJmmVM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)