UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2h7yRaV6EH6DHZcZlbMhGCKWZPAUxPMgrDsXJCx2h8E='
WHERE
key_id = '7676b80d1f7380ab9e6caa3037205fd6700a1b24bd62dc22143b0292ff15615b'
AND (
token = '2h7yRaV6EH6DHZcZlbMhGCKWZPAUxPMgrDsXJCx2h8E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)