UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Bnb3bvAl8KgaNOmykK40Q//HvnP/eZ0/zfWo8aIFJcc='
WHERE
key_id = '2d9a8b969820e45abdf98e97edd7d695e404e1d8aa6c1c6692393c799bad0c8f'
AND (
token = 'Bnb3bvAl8KgaNOmykK40Q//HvnP/eZ0/zfWo8aIFJcc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)