UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qK1+mMKtQLTRIeqajD1QIqco4l44cOErpZUK6GcbeOM='
WHERE
key_id = '6f02a538a8e441729364870152eba6501ddbf22be07907e4ce6e65115ae90c2c'
AND (
token = 'qK1+mMKtQLTRIeqajD1QIqco4l44cOErpZUK6GcbeOM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)