UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KVpWLZmQ4v1ifuovbtlzw59T8eMw4vBM1RgSHk87HQo='
WHERE
key_id = '3e7bf225f36bfe3e14a8d924baea8dcc73adc94cbf88396c1658e7d9880390c8'
AND (
token = 'KVpWLZmQ4v1ifuovbtlzw59T8eMw4vBM1RgSHk87HQo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)