UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O7+anNnJkEQzqZwoBmGkBvybZheozPuUl8gnroOSNjU='
WHERE
key_id = 'd9ac1e3dd7b99977d9dbb8790a08997f945471e68e4738f43fd00ca3332fea25'
AND (
token = 'O7+anNnJkEQzqZwoBmGkBvybZheozPuUl8gnroOSNjU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)