UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mL4C/wdAJKk/aQUnQaOEqtBKjotPUICR5dn5j9gDTa4='
WHERE
key_id = 'a042209d3c9d0fd0707813380a62874cc639ecb1576190267107da51fe373cc8'
AND (
token = 'mL4C/wdAJKk/aQUnQaOEqtBKjotPUICR5dn5j9gDTa4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)