UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VRXJWV1hG6IM2XVnIz7JPn8O3SsZu8MIAzG5XZdrUII='
WHERE
key_id = '16b12b2393eaf9109a99bb7a46a2497def6f60a88878564733c8554ed97c8293'
AND (
token = 'VRXJWV1hG6IM2XVnIz7JPn8O3SsZu8MIAzG5XZdrUII='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)