UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M2JvEbJlhdkP25o3uKQdDXPTTgasA62ln1i3aB2pMhI='
WHERE
key_id = '7b7441171eebefcd5323bd3f2ac02345c145544f2712e8e43faa270adb3d2a92'
AND (
token = 'M2JvEbJlhdkP25o3uKQdDXPTTgasA62ln1i3aB2pMhI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)