UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4tdFANi0xd0Mn6PzJeJWoYOC4o5vdAwlUiSpv/UIXSA='
WHERE
key_id = '0fc95ed238ad6533c6213576ce669dfb15175df3ef2df599d5174fbcc7201acc'
AND (
token = '4tdFANi0xd0Mn6PzJeJWoYOC4o5vdAwlUiSpv/UIXSA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)