UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ngrv/wpndXZ1UPeHxxvgG8htA2HcbaIKRP4FJAsEA6I='
WHERE
key_id = '6c987dc7a565bc67aaf15154a2c982f36658a8551169446c9720da5aef294145'
AND (
token = 'Ngrv/wpndXZ1UPeHxxvgG8htA2HcbaIKRP4FJAsEA6I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)