UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jocDnnEYCWF4QiUj8G6FqXyEiBeTvDrObLGKDbT5tQ0='
WHERE
key_id = '7d3b78c8500af62545d6bc3c01243df5bae2ee17b6347aa9df761476ead0d068'
AND (
token = 'jocDnnEYCWF4QiUj8G6FqXyEiBeTvDrObLGKDbT5tQ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)