UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '74rDaAC/hijGZRRCOKt9gY8AuT7KYvUzRJoA77NoJr4='
WHERE
key_id = '09378aef4390c9dd9b49ff605431e64d4fbae2950dcc366080b144b181721666'
AND (
token = '74rDaAC/hijGZRRCOKt9gY8AuT7KYvUzRJoA77NoJr4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)