UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w1kiOqrV6uPjN0taMv/0yG76Tc8kX2FQJXUR+bz6i8w='
WHERE
key_id = '009cee17004c503f4d6b8483f331e9c607c588c2558c0f846de0e4c4a39bd688'
AND (
token = 'w1kiOqrV6uPjN0taMv/0yG76Tc8kX2FQJXUR+bz6i8w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)