UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AurTlFqVa5jIvf4bi+mwTE5L1BJQYW6Cn/xskxXx7aY='
WHERE
key_id = 'bb7816365fb663c2858c487b4f433307fd8b419c5e7dd0d1ed5446938b1679d2'
AND (
token = 'AurTlFqVa5jIvf4bi+mwTE5L1BJQYW6Cn/xskxXx7aY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)