UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9ILyEU2jgpcrFiiMFrQSrY/wreowVy6xTJ3XXA89V5c='
WHERE
key_id = 'cf9d5876777a2ceb68c0ee650fd72e35126e23b89139dc9a8a8002015e5f1711'
AND (
token = '9ILyEU2jgpcrFiiMFrQSrY/wreowVy6xTJ3XXA89V5c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)